package net.dipper.tankwar.editor.helper;

import net.dipper.tankwar.core.config.BackgroundItem;
import net.dipper.tankwar.core.config.BlockItem;
import net.dipper.tankwar.core.config.ConfigItem;
import net.dipper.tankwar.core.config.TowerItem;
import net.dipper.tankwar.core.config.UnitItem;

public class ObjectRendererFactory {

	public static ObjectRenderer newInstance(ConfigItem item) {
		if(item instanceof BackgroundItem){
			return new BackgroundRenderer((BackgroundItem)item);
		}else if(item instanceof BlockItem){
			return new BlockRenderer((BlockItem)item);
		}else if(item instanceof TowerItem){
			return new TowerRenderer((TowerItem)item);
		}else if(item instanceof UnitItem){
			return new UnitRenderer((UnitItem)item);
		}else{
			return new DefaultObjectRenderer(item);
		}
	}

}
